<?php
require_once $_SERVER['DOCUMENT_ROOT'].'/actions/admin/AdminAction.php';
require_once $_SERVER['DOCUMENT_ROOT'].'/actions/Response.php';
require_once $_SERVER['DOCUMENT_ROOT'].'/model/Service/Service.php';
require_once $_SERVER['DOCUMENT_ROOT'].'/model/Service/ServiceFactory.php';

final class PersonDeleteAction extends AdminAction {
	protected function execute(Response $response) {
		if(isset($_POST['identity'])) {
			$serviceFactory = new ServiceFactory();
			$service = $serviceFactory->getService('PersonService');
			$service->delete($_POST['identity']);
		}
		$response->setActionPath('/person/index.html');
	}
}
?>